package xyz.fefine;

/**
 * Created by feng_ on 2016/8/31.
 * 支持三种类型的数据
 * 1:标识符
 * 2:整型
 * 3:字符型
 */
public abstract class Token {
    public static final Token EOF = new Token(-1) {};   //end of file
    public static final String EOL = "\\n";             //end of line
    private int lineNumber;
    protected Token(int line) {
        lineNumber = line;
    }

    public int getLineNumber(){
        return lineNumber;
    }
    public boolean isIdentifier(){return false;}
    public boolean isNumber(){return false;}
    public boolean isString(){return false;}
    public int getNumber(){throw new StoneException("not number token!");}
    public String getString(){return "";}
}

